package org.example.controller;


import lombok.extern.slf4j.Slf4j;
import org.example.model.ProductInfo;
import org.example.service.ProductService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Slf4j
@RequestMapping("/product")
@RestController
public class ProductController {

    @Autowired
    private ProductService productService;
    @RequestMapping("/{productId}")
    public ProductInfo getOrderById(@PathVariable("productId") Integer productId){
        log.info("接收到参数: productId"+productId);
        return productService.selectOrderById(productId);
    }
}
